package jjn.round1;

import commons.ListNode;

/**
 * @author Jjn
 * @since 2022-07-28 18:48
 */
public class LeetCode206_ReverseLinkedList {
    public ListNode reverseList(ListNode head) {
        ListNode current = head;
        ListNode newHead = null;
        while (current != null) {
            ListNode temp = current.next;
            current.next = newHead;
            newHead = current;
            current = temp;
        }
        return newHead;
    }
}
